# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=roc-toolkit
pkgver=0.1.5
pkgrel=2
_commit="c89687330bfce6f4dce79826f7a235b581f2b49d"
pkgdesc="Real-time audio streaming over the network"
url="https://roc-streaming.org/"
arch="all"
license="MPL-2.0"
makedepends="
	gengetopt
	libunwind-dev
	libuv-dev
	ragel
	scons
	"
checkdepends="
	cpputest
	python3
	"
subpackages="$pkgname-libs $pkgname-dev"
source="https://github.com/roc-streaming/roc-toolkit/archive/v$pkgver/roc-toolkit-$pkgver.tar.gz
	0001-Remove-deprecated-scons-call.patch
	0002-Fix-compatibility-with-new-SCons.patch
	0003-libunwind-aarch64.patch
	"

case "$CARCH" in
arm*|x86)
	# fail on 32-bit
	# original: -0.999969,	received: -0.993927
	options="$options !check"
esac

_run_scons() {
	local _check=""
	if ! want_check; then
		_check="--disable-tests"
	fi
	scons \
		--prefix="$pkgdir"/usr \
		--with-libraries=/usr/lib \
		--disable-examples \
		--disable-sox \
		--disable-openfec \
		--disable-pulseaudio \
		$_check \
		$@
}

build() {
	_run_scons
}

check() {
	_run_scons test
}

package() {
	_run_scons install
}

sha512sums="
eb82228293a96933482924b408d2b178c3a1f0b99b47a9bee309a653a2befeb022436386c7017eec1559677d7740b0c31fbe799bf155ef2154bf545b9d22396e  roc-toolkit-0.1.5.tar.gz
927b3eaacb9fbaeaea6dd6147c08233767df06f01a4ce1d53726d1de5b9c0b6e3d01136f4f9f047b099fcb871555cd9ecbb91cbbea57dccdc1f09eb2dc9ebeb3  0001-Remove-deprecated-scons-call.patch
7c97950a8f321a7249a62a655314ae7d40b4ba318ed090fc474d42d7dd3787d33ff64d21fc6b81f6f1a3b7cd9bedef98870d1995693e7e1a9e4ffb374d6ee4d3  0002-Fix-compatibility-with-new-SCons.patch
c2df5ba3fd0514fb732e9d796b204a66fb5503004c6c805cc7ebf5b338d8d99cebeb012f84f9f064600c22d4f91bf66d27d55a8e1d83c2ef936b21d732345d79  0003-libunwind-aarch64.patch
"
